package study2018._0510;

public class VolatileDemo {
	private static boolean isOver = false;

	public static void main(String[] args) {
		Thread thread = new Thread(new Runnable() {
			@Override
			public void run() {
				while (!isOver) {
					System.out.println(1);
					break;
				}
				;
			}
		});
		thread.start();
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		isOver = true;
	}
}
